export default {
    data(){
        return{
            // 页面权限
				permiList: [],
                menuCode: '',
                pageIndex: 1,
				pageSize: 50,
				total: 0,
				pageNum:[10,20,50,100,200]
        }
    },
    mounted(){
        this.getPagePermis() 
    },
    methods:{
		alertMessage(){
			this.$alert('请选择一条记录进行操作！', '提示', { confirmButtonText: '确定',type: 'warning'});
		},
        // 分页
			handleSizeChange(val) {
				this.pageSize = val
				this.getData(1, val)
			},
			handleCurrentChange(val) {
				this.pageIndex = val
				this.getData(val, this.pageSize)
			},
            
			// 获取当前页面
			getPagePermis() {
				let allMenu = JSON.parse(localStorage.getItem('allMenu'));
				let name = this.$route.name;
				this.pagePermission(name, allMenu)
			},
			pagePermission(name, allMenu) {
				allMenu = Array.from(allMenu)
				allMenu.forEach((item) => {
					if (item.name == name) {
						this.permiList = item.sysFunc;
						this.menuCode = item.menuCode;
					} else if (item.children && item.children.length > 0) {
						item.children = Array.from(item.children);
						this.pagePermission(name, item.children);
					}
				});
			},
    }
}